package com.dy.placeOrder2.mapper;

import com.dy.pojo.Orders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */
public interface OrdersMapper extends BaseMapper<Orders> {
    @Select("SELECT * FROM orders WHERE status = #{status} ORDER BY id DESC")
    List<Orders> listOrdersByStatus(@Param("status") String status);
    @Select("SELECT * FROM orders WHERE bq = #{bq}")
    List<Orders> listOrdersByBq(@Param("bq") String bq);
    @Select("SELECT o.*,u.name seller,u.image uimage FROM `orders` o LEFT JOIN user u on o.sellerid=u.id ORDER BY id DESC")
    List<Orders> listAll();
}
